Add timeout and in-flight observability to OperationTimedOut#818
Open
mykaul wants to merge 2 commits intoscylladb:masterfrom
Open
Add timeout and in-flight observability to OperationTimedOut#818mykaul wants to merge 2 commits intoscylladb:masterfrom
mykaul wants to merge 2 commits intoscylladb:masterfrom
Conversation
The error message at Cluster.add_execution_profile() had an unfilled %s placeholder: 'Failed to create all new connection pools in the %ss timeout.' The pool_wait_timeout value was never interpolated into the string, so users would see a literal '%s' instead of the actual timeout value. Signed-off-by: Yaniv Kaul <yaniv.kaul@scylladb.com>
Author
|
Code looks reasonable to me. Main question - do we want to log as warning, and not as debug, the timeout logs? |
Lorak-mmk
requested changes
Apr 15, 2026
Lorak-mmk
left a comment
There was a problem hiding this comment.
2 problems:
- Putting additional info in exceptions is fine, and is the correct way to get such info to users. Logging such things is not. Those are log on execution path (= spammy), printed in situations that can occur during normal operations. Let's keep the info in exception, it will be enough, and it was always how we got such info to user.
- IIUC
in_flightparameter is supposed to help verify if the timeout was encountered because of slow response from server, or because of wait on available stream on a connection.in_flightseems like not a great way to do this. More direct way would be to imo measure a time it actually took to get a stream id inborrow_connectionfunction.
Author
|
Thanks @Lorak-mmk , see below:
OK, I'll remove.
I think it should go into a separate item. Should I remove the 'in flight' for the time being, if we think it's not useful enough? What's the downside of having it, btw? Misleading? |
Collaborator
94fe0b7 to
56b57c0
Compare
Improve timeout observability in the driver, inspired by the Go driver PR scylladb/gocql#847. OperationTimedOut now carries optional timeout and in_flight fields that are appended to the exception message when present (e.g. "(timeout=10.0s, in_flight=42)"). All seven production raise sites in connection.py and cluster.py pass these values where available. Additionally, debug-level log lines are emitted for: - Client-side request timeouts (host, timeout, in_flight, orphaned) - Server-side read/write timeouts (host, consistency, received/required, data_retrieved/write_type, retry decision) A helper _retry_decision_name() translates RetryPolicy constants to human-readable strings for the log messages. New keyword-only parameters are backward compatible — existing callers that pass only positional errors/last_host continue to work unchanged. Fixes: DRIVER-538 Signed-off-by: Yaniv Kaul <yaniv.kaul@scylladb.com>
56b57c0 to
476531c
Compare
Author
Done. |
Lorak-mmk
approved these changes
Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improve timeout observability in the Python driver, inspired by the Go driver PR scylladb/gocql#847.
%sformat string inadd_execution_profiletimeout message (cherry-pickable)timeoutandin_flightfields toOperationTimedOutChanges
OperationTimedOutenhancement (cassandra/__init__.py)timeoutandin_flightkeyword parameters (backward compatible)(timeout=Xs, in_flight=N)when timeout is setNoneor0, no timeout info is printedAll raise sites updated (
cassandra/connection.py,cassandra/cluster.py)timeout=andin_flight=where availableTests
OperationTimedOutmessage formatting and attribute accesstimeoutandin_flightvaluesFixes: DRIVER-538